<?php
class logisticsmanager_waybill_jdalpha {
    /**
     * 获取物流公司编码
     * @param Sring $logistics_code 物流代码
     */
    public function logistics($logistics_code) {
        #'mode'=>'direct'直营，'mode'=>'join'加盟
        $logistics = array(
            'ZTO'   => array('code' => 'ZTO', 'name' => '中通速递','jdalpha_code'=>'ZTO','mode'=>'join'),
            'YUNDA' => array('code' => 'YUNDA', 'name' => '韵达快递','jdalpha_code'=>'YUNDA','mode'=>'join'),
            'STO'   => array('code' => 'STO', 'name' => '申通快递','jdalpha_code'=>'STO','mode'=>'join'),
            'UC'    => array('code' => 'UC', 'name'=>'优速快递','jdalpha_code'=>'UC','mode'=>'join'),
            'QFKD'  => array('code' => 'QFKD', 'name'=>'全峰快递','jdalpha_code'=>'QFKD','mode'=>'join'),
            'GTO'  => array('code' => 'GTO', 'name' => '国通快递','jdalpha_code'=>'GTO','mode'=>'join'),
            'UAPEX' =>  array('code' => 'UAPEX', 'name'=>'全一快递','jdalpha_code'=>'QY','mode'=>'join'),            #京东alpha获取面单时，要换为：QY
            'SURE'  => array('code'=>'SURE','name'=>'速尔快递','jdalpha_code'=>'SE','mode'=>'join'),                 #京东alpha获取面单时，要换为：SE
            'FAST'  => array('code' => 'FAST', 'name'=>'快捷快递','jdalpha_code'=>'KJKD','mode'=>'join'),            #京东alpha获取面单时，要换为：KJKD
            'EMS'   => array('code'=>'EMS','name'=>'邮政EMS经济快递','jdalpha_code'=>'EMS','mode'=>'direct'),
            'EMSBZ'   => array('code'=>'EMSBZ','name'=>'邮政EMS标准快递','jdalpha_code'=>'EMSBZ','mode'=>'direct'),
            'ZJS'   => array('code' => 'ZJS', 'name'=>'宅急送','jdalpha_code'=>'ZJS','mode'=>'direct'),
            'POSTB'  => array('code' => 'POSTB', 'name' => '邮政国内小包','jdalpha_code'=>'POSTB','mode'=>'direct'),   #京东alpha获取面单时，要换为：ZGYZZHD
            'ky-express'=> array('code' => 'ky-express', 'name' => '跨越速运','jdalpha_code'=>'KYSD','mode'=>'direct'), #京东alpha获取面单时，要换为：KYSD
            'SF'    => array('code'=>'SF','name'=>'顺丰快递','jdalpha_code'=>'SF','mode'=>'direct'),
            'YTO'   => array('code' => 'YTO','name'=>'圆通快递','jdalpha_code'=>'YTO','mode'=>'join'),
        );
        if (!empty($logistics_code)) {
            return $logistics[$logistics_code];
        }
        return $logistics;
    }
    function  get_ExpType($type){
        $logistics = array(
            'SF'=>array(
                1=>'顺丰次日',
                2=>'顺丰隔日',
            ),
        );
        if($logistics){
            return $logistics[$type];
        }else{
            return '';
        }
    }
    public function pay_method($method = '') {
        $payMethod = array(
            '1' => array('code' => '1', 'name' => '寄方付'),
            '2' => array('code' => '2', 'name' => '收方付'),
            '3' => array('code' => '3', 'name' => '第三方支付'),
        );
        if (!empty($method)) {
            return $payMethod[$method];
        }
        return $payMethod;
    }
}